package com.yc.cloudvideo.sp_store.mapper;

import com.yc.cloudvideo.entity.StoreFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.cloudvideo.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LYYT
 * @since 2022-08-03
 */
public interface StoreFileMapper extends BaseMapper<StoreFile> {

    //分页查询仓库文件
    @Select("select * from store_file where cid=#{cid} order by id desc limit #{begin},#{num}")
    @Results(value = {
            @Result(property = "fid",column = "fid",id = true),
            @Result(property = "file",column = "fid",
                    one = @One(select = "com.yc.cloudvideo.sp_store.mapper.FileMapper.selectFileByFid"))
    })
    List<StoreFile> selectFilesByCidPage(@Param("cid") int cid, @Param("begin") int begin, @Param("num") int num);
}
